<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function chkinput(){
	var propertyId = document.form.propertyId.selectedIndex;
	var privacyId = document.form.privacyId.selectedIndex;
	var accommodates = document.form.accommodates.selectedIndex;
	var bedrooms = document.form.bedrooms.selectedIndex;
	var title = document.form.title;
	var description = document.form.description;
	var phone_1 = document.form.phone_1.selectedIndex;
	var phone_2 = document.form.phone_2;
	var phone_3 = document.form.phone_3;
	var nation = document.form.nation;
	var zipcode = document.form.zipcode;
	
 	if(propertyId=="0"){
		alert("객실종류를 선택해주세요.");
		return false;
	}
 	if(privacyId=="0"){
		alert("랜탈범위를 선택해주세요.");
		return false;
	} 
 	if(accommodates=="0"){
		alert("숙박가능인원을 선택해주세요.");
		return false;
	}
 	if(bedrooms=="0"){
		alert("침실수를 선택해주세요.");
		return false;
	}
	if(title.value==""){
		alert("제목을 입력해주세요.");
		title.focus();
		return false;
	}
	if(description.value==""){
		alert("설명을 입력해주세요.");
		description.focus();
		return false;
	}
  	if(phone_1=="0"){
		alert("휴대폰번호를 선택해주세요.");
		return false;
	} 
	if(phone_2.value==""){
		alert("전화번호를 입력해주세요.");
		phone_2.focus();
		return false;
	}
	if(phone_3.value==""){
		alert("전화번호를 입력해주세요.");
		phone_3.focus();
		return false;
	}
	if(nation.value==""){
		alert("국가를 입력해주세요.");
		nation.focus();
		return false;
	}
	if(zipcode.value==""){
		alert("우편번호를 입력해주세요.");
		return false;
	}
}
function searchAddress(){
	window.open("address_popup.jsp","주소검색","scrollbars=yes,width=300,height=300 ,top=100,left=900");
	var e2 = document.getElementById("e2");
	e2.disabled=true;
	var e3 = document.getElementById("e3");
	e3.disabled=true;
	var e4 = document.getElementById("e4");
	e4.disabled=true;
	var e5 = document.getElementById("e5");
	e5.disabled=true;
}
</script>
</head>
<body>
<form action="roominputbasic.do" method="post" name="form" onsubmit="return chkinput()">
<h2>회원님의 객실 정보</h2>
<h4>숙소가 정말 좋고 특이하네요. 여행객들에게 왜 당신에 숙소를 이용해야만 하는지 알려주세요. 장점을 꼭 강조하세요! </h4>
<table bgcolor="#F5FFFA" cellpadding="10" cellspacing="0">
	<tr>
		<td bgcolor="#E0FFFF" width="150"> 객실종류 </td>
		<td><select name="propertyId">
				<option value="default">선택해주세요</option>
				<option value="A">아파트</option>
				<option value="B">단독주택</option>
				<option value="C">민박</option>
				<option value="D">원룸</option>
				<option value="E">별장</option>
				<option value="F">다세대주택</option>
				</select></td></tr>
	<tr>
		<td bgcolor="#F0F8FF"> 랜트범위 </td>
		<td><select name="privacyId">
					<option value="default">선택해주세요</option>
					<option value="A">개인방</option>
					<option value="B">다인실</option>
					<option value="C">집/아파트 전체</option>
					</select></td></tr>
	<tr>
		<td bgcolor="#E0FFFF"> 숙박가능인원 </td>
		<td><select name="accommodates">
					<option value="default">선택해주세요</option>
					<option>1</option>
					<option>2</option>
					<option>3</option>
					<option>4</option>
					<option>5</option>
					<option>6</option>
					<option>7</option>
					<option>8</option>
					<option>9</option>
					<option>10</option>
					<option>11</option>
					<option>12</option>
					<option>13</option>
					<option>14</option>
					<option>15</option>
					<option>16+</option>				
					</select></td></tr>
	<tr>
		<td bgcolor="#F0F8FF"> 침실수 </td>
		<td><select name="bedrooms">
					<option value="default">선택해주세요</option>
					<option>1</option>
					<option>2</option>
					<option>3</option>
					<option>4</option>
					</select></td></tr>
	<tr>
		<td bgcolor="#E0FFFF"> 제목 </td>
		<td><input type="text" name="title"></td>
	<tr>
		<td bgcolor="#F0F8FF"> 설명</td>
		<td><textarea name="description" rows="20" cols="80"></textarea></td></tr>
	<tr>
		<td bgcolor="#E0FFFF">휴대폰번호 </td>
		<td><select name="phone_1">
					<option value="default">선택해주세요</option>
					<option value="010">010</option>
					<option value="011">011</option>
					<option value="016">016</option>
					<option value="017">017</option>
					<option value="018">018</option>
					<option value="019">019</option>
					</select> - <input type="text" name="phone_2" maxlength="4"> - <input type="text" name="phone_3" maxlength="4"></td></tr>
	<tr>
		<td bgcolor="#F0F8FF"> 국가 </td>
		<td><input type="text" name="nation"></td></tr>
	<tr>
</table>
<input type="hidden" name="seq"><br>
<h4>객실의 위치를 등록해주세요.</h4>
<table bgcolor="#FFFAF0" cellpadding="10" cellspacing="0">
	<tr>
		<td bgcolor="#F0F8FF" width="130"><input type="button" value="주소검색" onclick="searchAddress()" id="e1"></td>
		<td> <font color="red">※ 우편번호를 검색해주세요. </font></td>
	</tr>
	<tr>
		<td bgcolor="#F5F5F5"> 우편번호</td>
		<td><input type="text" name="zipcode" id="e2" disabled="disabled" size="50"></td></tr>
	<tr>
		<td bgcolor="#F0F8FF"> 시도 </td>
		<td><input type="text" name="sido" id="e3" disabled="disabled" size="50"></td></tr>
	<tr>
		<td bgcolor="#F5F5F5"> 구군 </td>
		<td><input type="text" name="gugun" id="e4" disabled="disabled" size="50"></td>
	<tr>
		<td bgcolor="#F0F8FF"> 동 </td>
		<td><input type="text" name="dong" id="e5" disabled="disabled" size="50"></td></tr>
	<tr>
		<td bgcolor="#F5F5F5">상세주소 </td>
		<td><input type="text" name="addDetail" size="70"></td></tr>	
</table>
	<p>
	<input type="submit" value="다음 페이지로">
</form>
</body>
</html>